<include file="Public:header" />
<div class="page-member subpage">
    <div class="form-header">
        <div>
            <div class="line1">
                <div class="fl"><h3>政务内容详情 / {$affairs.title}</h3></div>
                <div class="fr hidden">
                    <form class="search-form" method="post" action="">
                        <input name="field" value="{$context.field}" type="hidden" />
                        <input name="value" value="{$context.value}" type="hidden" />
                        <input name="page" value="{$context.page}" type="hidden" />
                        <input name="order_field" value="{$context.order_field}" type="hidden" />
                        <input name="order_sort" value="{$context.order_sort}" type="hidden" />
                        <input name="offset" value="{$context.offset}" type="hidden" />
                        <input name="id" value="{$context.id}" type="hidden" />
                    </form>
                </div>
            </div>
            <div class="line2">
                <!-- 编辑按钮组 -->
                <div class="fl form-btn-group btn-group-edit">
                    <in name="$x|default='03-01-08'" value="$rightsCode">
                        <button onclick="action_edit();" class="btn-save btn-highlight">编 辑</button>
                        <else />
                        <button disabled="disabled" class="btn-save btn-disable">编 辑</button>
                    </in>
                    <span>或</span>
                    <a class="linkBtn btn-abort" href="/admin/affairs/add">创建</a>
                </div>
                <!-- 保存按钮组 -->
                <div class="fl form-btn-group btn-group-save hidden">
                    <button onclick="action_save();" class="btn-save btn-highlight">保 存</button>
                    <span>或</span>
                    <a class="linkBtn btn-abort" onclick="action_abort();" href="javascript:void(0);">放弃</a>
                </div>
                <div class="fl form-btn-more">
                    <button class="btn-normal btn-more">
                        更多操作<i class="drop-down"></i>
                    </button>
                    <ul class="more-action hidden">
                        <in name="$x|default='03-01-08'" value="$rightsCode">
                            <li><a onclick="action_del2();" href="javascript:void(0);">删 除</a></li>
                            <li><a onclick="action_copy();" href="javascript:void(0);">复 制</a></li>
                        </in>
                    </ul>
                </div>
                <div class="fr form-search-count">
                    <span class="index">{$context.index}/{$page.total}</span>
                    <button onclick="ItemJump({$page.prev.id}, {$page.prev.offset});" class="btn-normal">上一条</button>
                    <button onclick="ItemJump({$page.next.id}, {$page.next.offset});" class="btn-normal">下一条</button>
                </div>
            </div>
        </div>
    </div>
    <div class="form-box2">
        <div>
            <form id="affairsForm" method="post" action="">
                <!--表单相关原始信息存储-->
                <input type="hidden" name="old_title" value="{$affairs.title}" />
                <input type="hidden" name="old_seq" value="{$affairs.seq}" />
                <input type="hidden" name="old_content" value="{$affairs.content}" />
                <input type="hidden" name="old_category" value="{$affairs.category}" />
                <input type="hidden" name="old_author" value="{$affairs.author}" />
                <input type="hidden" name="old_att1" value="{$affairs.att1}" />
                <input type="hidden" name="old_att2" value="{$affairs.att2}" />
                <input type="hidden" name="old_att3" value="{$affairs.att3}" />
                <input type="hidden" name="old_att1_name" value="{$affairs.att1_name}" />
                <input type="hidden" name="old_att2_name" value="{$affairs.att2_name}" />
                <input type="hidden" name="old_att3_name" value="{$affairs.att3_name}" />
                <input type="hidden" name="model" value="READ" />
                <table class="form">
                    <tr>
                        <th width="10%">标题<span class="hint">*</span></th>
                        <td width="40%" field="title">{$affairs.title}</td>
                        <th width="10%">作者</th>
                        <td field="author">{$affairs.author}</td>
                    </tr>
                    <tr>
                        <th>分类<span class="hint">*</span></th>
                        <td field="category">{$category[$affairs['category']]}</td>
                        <th>序号</th>
                        <td field="seq">{$affairs.seq}</td>
                    </tr>
                    <tr>
                        <th>内容<span class="hint">*</span></th>
                        <td field="content" colspan="3">
                            <textarea style="height:360px;width:95%;" name="content" id="content" placeholder="请输入备注信息">
                                {$affairs.content|html_entity_decode=###}
                            </textarea>
                        </td>
                    </tr>
                    <tr style="line-height:20px !important;">
                        <th>附件</th>
                        <td class="attachments" name="attachments" colspan="2">
                            <input name="att1" value="{$affairs.att1}" type="hidden" />
                            <input name="att2" value="{$affairs.att2}" type="hidden" />
                            <input name="att3" value="{$affairs.att3}" type="hidden" />
                            <input name="att1_name" value="{$affairs.att1_name}" type="hidden" />
                            <input name="att2_name" value="{$affairs.att2_name}" type="hidden" />
                            <input name="att3_name" value="{$affairs.att3_name}" type="hidden" />
                            <neq name="affairs.att1" value="">
                                <div class="item">
                                    <a target="_blank" href="{$affairs.att1}">{$affairs.att1_name}</a>
                                    <img onclick="removeAttach(this.name);" name="att1" src="__IMG__/close.png" />
                                </div>
                            </neq>
                            <neq name="affairs.att2" value="">
                                <div class="item">
                                    <a target="_blank" href="{$affairs.att2}">{$affairs.att2_name}</a>
                                    <img onclick="removeAttach(this.name);" name="att2" src="__IMG__/close.png" />
                                </div>
                            </neq>
                            <neq name="affairs.att3" value="">
                                <div class="item">
                                    <a target="_blank" href="{$affairs.att3}">{$affairs.att3_name}</a>
                                    <img onclick="removeAttach(this.name);" name="att3" src="__IMG__/close.png" />
                                </div>
                            </neq>
                        </td>
                        <td>
                            <button onclick="addAttachment();" type="button" style="padding:3px 6px;">添加附件</button>
                            <input type="file" name="upload" class="hidden" />
                            <label style="color:red;">最多上传3个</label>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<script charset="utf-8" src="__JS__/kindeditor/kindeditor-all-min.js"></script>
<script>
    /**
     * 全局变量 fields
     */
    var fields = new Array("title", "content", "seq", "author", "category",
            "att1", "att2", "att3", "att1_name", "att2_name", "att3_name");
    var options = {$options};
    var closeBtnLink = '__IMG__/close.png';
    var editor1 = null;
    KindEditor.ready(function(K) {
        editor1 = K.create('textarea[name="content"]', {
            readonlyMode: true,
            items: ['fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic',
                'underline', 'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright',
                'insertorderedlist', 'insertunorderedlist', '|', 'emoticons', 'image', 'link'],
        });
    });
</script>
<script src="__JS__/affairs.js" type="text/javascript" ></script>
<include file="Public:footer" />
